package GameModel;

import java.util.ArrayList;

import Player.mPlayer;
import Server.mRegisteredPlayers;

public class __test__Wetten_funtzen {
 public static void main (String... args) {
	 try {
	 ArrayList<mPlayer> AL = mRegisteredPlayers.get();
	mCard dummycard = null;	
	 System.out.println(AL.toString());
		mPlayer p1 = AL.get(0);
		mPlayer p2 = AL.get(1);
		mPlayer p3 = AL.get(2);
		
		mGame game = new mGame("Mein Spiel", 2, 300, p1);
		game.addPlayerKonto(p2);
//		game.addPlayerKonto(p3);
		
		
		 //No joker!
		
//		 dummycard = new mCard(eCardColor.JOKER, 1);
//		 set.add(dummycard);
//		 dummycard = new mCard(eCardColor.JOKER, 2);
//		 set.add(dummycard);
//		 dummycard = new mCard(eCardColor.JOKER, 3);
//		 set.add(dummycard);
		 
	//	ArrayList
		 
		 game.addBet("big_bet", p1);
		 game.addBet("big_bet", p2);
//		 game.addBet("big_bet", p3);
		 for (int i=0;i<14;i++) {
			 
			 ArrayList<mCard> set = new ArrayList<mCard>();
			 set.add(game.getHandCardsByPlayer(game.getCurrentPlayer()).get(0));
			 
		 System.out.println("-----------------------------------------");
		 System.out.println("turn is valid: "+game.newCardCombo(set, game.getCurrentPlayer()));
		 System.out.println("-----------------------------------------");
//		 game.addPassPlayer(game.getCurrentPlayer());
		 if (game.getLastCardCombo()!=null && game.getCurrentPlayer()!=null) {
			 game.addPassPlayer(game.getCurrentPlayer());
			 }
		 }
//		 
//for (int i=0;i<14;i++) {
//			 ArrayList<mCard> set = new ArrayList<mCard>();
//			 set.add(game.getHandCardsByPlayer(game.getCurrentPlayer()).get(0));
//			 
//		 System.out.println("-----------------------------------------");
//		 System.out.println("turn is valid: "+game.newCardCombo(set, game.getCurrentPlayer()));
//		 System.out.println("-----------------------------------------");
//		 if (game.getLastCardCombo()!=null && game.getCurrentPlayer()!=null) {
//		 game.addPassPlayer(game.getCurrentPlayer());
//		 }
//		 }
//		 
		 
		 for (mGameStat gs: game.getPlayerIngameKonto()) {
			 System.out.println("Spieler "+gs.getPlayer().getUserName()+" hat folgende Punktzahl:  "+gs.getGamePoints());
		 }
		 
		 System.out.println(game.getCurrentPlayer());
		 
		
	 } catch (Exception e) {
		 e.printStackTrace();
	 }
 }
}
